package Common;

import java.util.Arrays;
import java.util.List;



public class ResultMessage {
	
	public int returnCode;
    public String errorMessage;
    
    public ResultMessage(int code, String msg){
    	returnCode = code;
    	errorMessage = msg;
    }
    
    public ResultMessage(String msg){
    	List<String> msglist = Arrays.asList(msg.split(Share.DELIMETER));
		if(msglist.size() >=2 ){
			returnCode = Integer.parseInt(msglist.get(0));
			errorMessage = msglist.get(1);
		}
    }
    
    public String getString(){
    	return returnCode + Share.DELIMETER + errorMessage;
    }
    
    
}
